public class ForGetSumDemo {
    public static void main(String[] args) {
//        用for循环输出数组的和
    int[] arr=new int[]{2,4,6,8,10};
    int sum=0;
    for (int i=0;i< arr.length;i++){

        sum=sum+arr[i];

    }
    System.out.println(sum);
}
}
